package com.dy.lock.screen.service.impl;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.dy.lock.screen.dao.MaterialCollectDao;
import com.dy.lock.screen.pojo.MaterialCollectInfo;
import com.dy.lock.screen.service.MaterialCollectService;

@Service("materialCollectService")
public class MaterialCollectServiceImpl implements MaterialCollectService {

	@Resource(name = "materialCollectDao")
	private MaterialCollectDao materialCollectDao;

	@Override
	public MaterialCollectInfo queryByPrimaryKey(String id) {
		return this.materialCollectDao.queryByPrimaryKey(id);

	}

	@Override
	public Integer queryCount(Map<String, Object> para) {
		return this.materialCollectDao.queryCount(para);
	}

	@Override
	public int save(MaterialCollectInfo collectInfo) {
		collectInfo.setId(UUID.randomUUID().toString());
		collectInfo.setCollectTime(new Date());
		int re = this.materialCollectDao.insert(collectInfo);
		return re;
	}

	@Override
	public int delete(MaterialCollectInfo collectInfo) {
		int re = this.materialCollectDao.delete(collectInfo);
		return re;
	}

	@Override
	public MaterialCollectInfo queryByMidAndCid(MaterialCollectInfo collectInfo) {
		return this.materialCollectDao.queryByMidAndCid(collectInfo);
	}

	@Override
	public List<MaterialCollectInfo> queryPage(Map<String, Object> para) {
		// TODO Auto-generated method stub
		return this.materialCollectDao.queryT(para);
	}

}
